
#include "geomSetupDifference.h"

geomSetupDifference::geomSetupDifference()
{
    tb_build = new QToolButton();
    tb_build->setText("构建");
    tb_build->setIcon(QIcon(":/Geometry/resources/Geometry/buildShape.png"));
    tb_build->setIconSize(QSize(20, 20));
    tb_build->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    tb_build->setAutoRaise(true);

    label_select = new QLabel();
    label_select->setText("并集");
    label_select->setStyleSheet("background-color: #B9D1ED;");

    // 1
    label_hint = new QLabel();
    label_hint->setText("被减对象：");
    list = new QListWidget();

    tb_add = new QToolButton();
    tb_add->setText("添加");
    tb_add->setIcon(QIcon(":/Geometry/resources/Geometry/buildShape.png"));
    tb_add->setIconSize(QSize(20, 20));
    tb_add->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    tb_add->setAutoRaise(true);

    tb_remove = new QToolButton();
    tb_remove->setText("删除");
    tb_remove->setIcon(QIcon(":/Geometry/resources/Geometry/buildShape.png"));
    tb_remove->setIconSize(QSize(20, 20));
    tb_remove->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    tb_remove->setAutoRaise(true);

    tb_clear = new QToolButton();
    tb_clear->setText("清空");
    tb_clear->setIcon(QIcon(":/Geometry/resources/Geometry/buildShape.png"));
    tb_clear->setIconSize(QSize(20, 20));
    tb_clear->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    tb_clear->setAutoRaise(true);

    hLayout = new QHBoxLayout();
    hLayout->addWidget(tb_add);
    hLayout->addWidget(tb_remove);
    hLayout->addWidget(tb_clear);
    hSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
    hLayout->addItem(hSpacer);

    // 2
    line = new QFrame();
    line->setObjectName("line");
    line->setFrameShape(QFrame::HLine);
    line->setFrameShadow(QFrame::Sunken);

    label_hint_2 = new QLabel();
    label_hint_2->setText("减去的对象：");
    list_2 = new QListWidget();

    tb_add_2 = new QToolButton();
    tb_add_2->setText("添加");
    tb_add_2->setIcon(QIcon(":/Geometry/resources/Geometry/buildShape.png"));
    tb_add_2->setIconSize(QSize(20, 20));
    tb_add_2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    tb_add_2->setAutoRaise(true);

    tb_remove_2 = new QToolButton();
    tb_remove_2->setText("删除");
    tb_remove_2->setIcon(QIcon(":/Geometry/resources/Geometry/buildShape.png"));
    tb_remove_2->setIconSize(QSize(20, 20));
    tb_remove_2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    tb_remove_2->setAutoRaise(true);

    tb_clear_2 = new QToolButton();
    tb_clear_2->setText("清空");
    tb_clear_2->setIcon(QIcon(":/Geometry/resources/Geometry/buildShape.png"));
    tb_clear_2->setIconSize(QSize(20, 20));
    tb_clear_2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    tb_clear_2->setAutoRaise(true);

    hLayout_2 = new QHBoxLayout();
    hLayout_2->addWidget(tb_add_2);
    hLayout_2->addWidget(tb_remove_2);
    hLayout_2->addWidget(tb_clear_2);
    hSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
    hLayout_2->addItem(hSpacer_2);

    vSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);

    // grid layout
    int i = 0;
    gl->addWidget(tb_build,       i,   0, 1, 1);
    gl->addWidget(label_select,   ++i, 0, 1, 1);
    gl->addWidget(label_hint,     ++i, 0, 1, 1);
    gl->addWidget(list,           ++i, 0, 1, 1);
    gl->addItem(hLayout,          ++i, 0, 1, 1);

    gl->addWidget(line,           ++i, 0, 1, 1);
    gl->addWidget(label_hint_2,   ++i, 0, 1, 1);
    gl->addWidget(list_2,         ++i, 0, 1, 1);
    gl->addItem(hLayout_2,        ++i, 0, 1, 1);

    gl->addItem(vSpacer,          ++i, 0, 1, 1);

}

